package com.dragon.repository.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dragon.repository.entity.AttendanceReplace;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 补卡表 Mapper 接口
 * </p>
 *
 * @author sy
 * @since 2023-08-15
 */
@Mapper
public interface AttendanceReplaceMapper extends BaseMapper<AttendanceReplace> {

    @Select("select M.* from (" +
            "select dar.*, da.username FROM dragon_attendance_replace dar left join " +
            "dragon_admin da on dar.admin_id = da.id )M " +
            "${ew.customSqlSegment} ")
    Page<AttendanceReplace> selectReplacePage(Page<AttendanceReplace> replacePage, @Param(Constants.WRAPPER) QueryWrapper<AttendanceReplace> wrapper);
}
